using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using WindowsLive.Writer.Api;

namespace MessengerQuotePlugin
{
    [WriterPluginAttribute
       ("FBF2B72E-F112-420A-8B48-CA73ECA96267",
        "Messenger Quote",
        Description = "Inserts a quoted text from your Windows Live Messenger history in your blog",
        ImagePath = "Images.Messenger.png",
        PublisherUrl = "http://www.tozon.info")]
    [InsertableContentSourceAttribute("Messenger Quote")]
    public class Plugin: ContentSource
    {
        public override DialogResult CreateContent(IWin32Window dialogOwner, ref string newContent)
        {
            using (MainForm form = new MainForm())
            {
                DialogResult result = form.ShowDialog(dialogOwner);
                if ( result == DialogResult.OK)
                {
                    newContent = form.GetQuote();
                }
                return result;
            }
        }
    }
}